﻿//
//                       _oo0oo_
//                      o8888888o
//                      88" . "88
//                      (| -_- |)
//                      0\  =  /0
//                    ___/`---'\___
//                  .' \\|     |// '.
//                 / \\|||  :  |||// \
//                / _||||| -:- |||||- \
//               |   | \\\  -  /// |   |
//               | \_|  ''\---/''  |_/ |
//               \  .-\__  '-'  ___/-. /
//             ___'. .'  /--.--\  `. .'___
//          ."" '<  `.___\_<|>_/___.' >' "".
//         | | :  `- \`.;`\ _ /`;.`/ - ` : | |
//         \  \ `_.   \_ __\ /__ _/   .-` /  /
//     =====`-.____`.___ \_____/___.-`___.-'=====
//                       `=---='
//
//
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//               佛祖保佑         永无BUG
//
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

#region << 版 本 注 释 >>

/*----------------------------------------------------------------
* 类 名 称 ：GameStateBase
* 类 描 述 ：
* 作    者 ：henrychang
* 创建时间 ：2019/1/28 10:58:39
*******************************************************************
* Copyright @ henrychang 2018. All rights reserved.
*******************************************************************
//----------------------------------------------------------------*/

#endregion << 版 本 注 释 >>

using TouchFish.StateMachine;
using UnityEngine;
using GameStateOwner = TouchFish.StateMachine.IStateMachine<TouchFish.GameState.IGameStateManager>;

namespace TouchFish.GameState
{
    public abstract class GameStateBase : State<IGameStateManager>
    {
        /// <summary>
        /// 状态初始化时调用
        /// </summary>
        /// <param name="procedureOwner">流程持有者。</param>
        protected internal override void OnInit(GameStateOwner gameStateOwner)
        {
            base.OnInit(gameStateOwner);
        }

        /// <summary>
        /// 进入状态时调用
        /// </summary>
        /// <param name="procedureOwner">游戏状态持有者</param>
        protected internal override void OnEnter(GameStateOwner gameStateOwner)
        {
            base.OnEnter(gameStateOwner);
            Debug.Log("Enter '{0}' procedure." + GetType().FullName);
        }

        /// <summary>
        /// 状态轮询时调用
        /// </summary>
        /// <param name="procedureOwner">游戏状态持有者</param>
        protected internal override void OnUpdate(GameStateOwner gameStateOwner)
        {
            base.OnUpdate(gameStateOwner);
        }

        /// <summary>
        /// 离开状态时调用
        /// </summary>
        /// <param name="procedureOwner">游戏状态持有者</param>
        protected internal override void OnLeave(GameStateOwner gameStateOwner)
        {
            base.OnLeave(gameStateOwner);
            Debug.Log("Leave '{0}' procedure." + GetType().FullName);
        }

        /// <summary>
        /// 状态销毁时调用
        /// </summary>
        /// <param name="procedureOwner">游戏状态持有者</param>
        protected internal override void OnDestroy(GameStateOwner gameStateOwner)
        {
            base.OnDestroy(gameStateOwner);
        }
    }
}